package com.xxl.job.admin.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.xxl.job.admin.core.model.JobGroup;
import com.xxl.job.admin.core.route.ExecutorRouteStrategyEnum;
import com.xxl.job.admin.dao.IJobGroupDao;
import com.xxl.job.admin.service.IJobService;
import com.xxl.job.core.glue.GlueTypeEnum;

/**
 * index controller
 * @author xuxueli 2015-12-19 16:13:16
 */
@Controller
@RequestMapping("/jobinfo")
public class JobInfoController {

	@Resource
	private IJobGroupDao xxlJobGroupDao;
	@Resource
	private IJobService xxlJobService;
	
	@RequestMapping
	public String index(Model model) {

		// 路由策略-列表
		model.addAttribute("ExecutorRouteStrategyEnum", ExecutorRouteStrategyEnum.values());

		// Glue类型-字典
		model.addAttribute("GlueTypeEnum", GlueTypeEnum.values());

		// 任务组
		List<JobGroup> jobGroupList =  xxlJobGroupDao.findAll();
		model.addAttribute("JobGroupList", jobGroupList);
		return "/jobinfo/jobinfo.index.ftl";
	}
	
	
}
